package com.dd.cloud.user.entity.chknowl;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.dd.cloud.common.annotate.FileSuffix;
import com.dd.cloud.common.annotate.validation.Name;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 中成药
 * </p>
 *
 * @author czg
 * @since 2022-07-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Table(comment = "中成药表")
public class ChknowlChPatent implements Serializable {

    private static final long serialVersionUID=1L;
    @TableId(value = "id", type = IdType.AUTO)
    @Column(isKey = true,isAutoIncrement = true)
    private Integer id;

    /**
     * 中成药名称
     */
    @Excel(name = "名称", width = 7)
    @Column(length = 20, comment = "中成药名称")
    @Name(begin = "中成药名称")
    private String name;

    /**
     * 中成药名称
     */
    @Column(length = 40, comment = "中成药名称拼音")
    private String namePinyin;

    /**
     * 处方
     */
    @Excel(name = "处方",orderNum = "1",width = 20)
    @Column(length = 512, comment = "处方")
    @Length(max = 512, message = "处方长度最大为512个字符")
    private String pres;

    /**
     * 功能主治
     */
    @Excel(name = "功能与主治",orderNum = "3",width = 20)
    @Column(length = 512, comment = "功能与主治")
    @Length(max = 512, message = "功能与主治长度最大为512个字符")
    private String indications;

    /**
     * 用法用量
     */
    @Excel(name = "用法用量",orderNum = "4",width = 15)
    @Column(length = 200, comment = "用法用量")
    @Length(max = 200, message = "用法用量长度最大为200个字符")
    private String dosage;

    /**
     * 性状
     */
    @Excel(name = "性状",orderNum = "2",width = 15)
    @Column(length = 512, comment = "性状")
    @Length(max = 512, message = "性状长度最大为512个字符")
    private String properties;

    /**
     * 规格
     */
    @Excel(name = "规格",orderNum = "6",width = 7)
    @Column(length = 150, comment = "规格")
    @Length(max = 150, message = "规格长度最大为150个字符")
    private String specs;

    /**
     * 注意事项
     */
    @Excel(name = "注意事项",orderNum = "5",width = 7)
    @Column(length = 512, comment = "注意事项")
    @Length(max = 512, message = "注意事项长度最大为512个字符")
    private String precautions;

    /**
     * 贮藏
     */
    @Excel(name = "贮藏",orderNum = "7",width = 7)
    @Column(length = 150, comment = "贮藏")
    @Length(max = 150, message = "贮藏长度最大为150个字符")
    private String depot;

    /**
     * 产地
     */
    @Excel(name = "产地",orderNum = "9",width = 7)
    @Column(length = 20, comment = "产地")
    @Name(required = false, begin = "产地")
    private String orgin;

    /**
     * 科室
     */
    @Excel(name = "科室",orderNum = "8",width = 7)
    @Column(length = 20, comment = "科室")
    @Name(required = false, begin = "科室")
    private String department;

    /**
     * 图片地址 多个,隔开 type excel类型 1文字默认 2图片 3函数 4数字 savePath保存在本机的地址,做中转传到文件服务器
     */
    @Excel(name = "图片",orderNum = "1",width = 9, type = 2,savePath = "image")
    @FileSuffix
    @Column(length = 500, comment = "图片地址")
    private String imgUrl;

    /**
     * 状态
     */
    @Column(comment = "状态")
    private Integer status;

    /**
     * 操作人id
     */
    @Column(comment = "操作人id")
    private Integer operId;

    /**
     * 操作人
     */
    @TableField(exist = false)  //表外字段
    private String operName;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间", defaultValue = "now()")
    private LocalDateTime createDate;

    /**
     * 操作时间
     */
    @Column(comment = "操作时间")
    private LocalDateTime operDate;
}
